package com.jiashihui.schema_lgorithm.schema.iterator;

/**
 * @author jiashihui
 * @describe: 集合实现类
 * @date 2019/03/15
 */
public class CollectionImpl implements Collection {

    private String string[] = {"A","B","C","D","E"};

    @Override
    public Iterator iterator() {
        return new IteratorImpl(this);
    }

    @Override
    public Object get(int index) {
        return string[index];
    }

    @Override
    public int size() {
        return string.length;
    }
}
